home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
ip
/
ka9q
/
src890906.arc
/
UDPCMD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-08-19
|
1KB
|
56 lines
/* UDP-related user commands */
#include <stdio.h>
#include "global.h"
#include "mbuf.h"
#include "netuser.h"
#include "udp.h"
#include "internet.h"
#include "cmdparse.h"
#include "commands.h"
static int doudpstat __ARGS((int argc,char *argv[],void *p));
static struct cmds Udpcmds[] = {
"status", doudpstat, 0, 0, NULLCHAR,
NULLCHAR,
};
int
doudp(argc,argv,p)
int argc;
char *argv[];
void *p;
{
return subcmd(Udpcmds,argc,argv,p);
}
void
st_udp(udp,n)
struct udp_cb *udp;
int n;
{
if(n == 0)
printf(" &UCB Rcv-Q Local socket\n");
printf("%8lx%6u %s\n",ptol(udp),udp->rcvcnt,pinet(&udp->socket));
}
/* Dump UDP statistics and control blocks */
static int
doudpstat(argc,argv,p)
int argc;
char *argv[];
void *p;
{
register struct udp_cb *udp;
register int i;
printf("sent %u rcvd %u bdcsts %u cksum err %u unknown socket %u\n",
Udp_stat.sent,Udp_stat.rcvd,Udp_stat.bdcsts,Udp_stat.cksum,Udp_stat.unknown);
printf(" &UCB Rcv-Q Local socket\n");
for(i=0;i<NUDP;i++){
for(udp = Udps[i];udp != NULLUDP; udp = udp->next){
st_udp(udp,1);
}
}
return 0;
}